//package com.dify.tool.common.config;
//
//import com.dify.tool.common.utils.ElasticsearchUtil;
//import jakarta.annotation.PostConstruct;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.beans.factory.annotation.Value;
//import org.springframework.stereotype.Component;
//
//
///**
// * @author shl
// * @date 2025-07-29
// * @description
// */
//@Component
//public class ElasticsearchIndexCreator {
//
//    @Value("${spring.elasticsearch.index.agentHistoryRecord}")
//    private String agentHistoryRecord;
//
//    @Autowired
//    private ElasticsearchUtil elasticsearchUtil;
//
//    @PostConstruct
//    public void init() {
//        try {
//            elasticsearchUtil.createIndex(agentHistoryRecord);
//        } catch (Exception e) {
//            throw new RuntimeException("Failed to create Elasticsearch index", e);
//        }
//    }
//}
